/**
 * $Id: SGIPSubmitRepMessage.java,v 1.1 2006/09/07 02:08:40 martin Exp $
 *
 * Copyright 2005 Skyinfo, Inc. All Rights Reserved.
 */
package com.haoxi.gateway.sgip12msg;


public class SGIPSubmitRepMessage extends SGIPMessage {

    public SGIPSubmitRepMessage(byte buf[]) throws IllegalArgumentException {
        super.buf = new byte[21];
        if (buf.length != 21) {
            throw new IllegalArgumentException(
                    "The message that is sent by SMC is wrong");
        } else {
            System.arraycopy(buf, 0, super.buf, 0, 21);
            decodeSeq();
        }
    }

    public int getResult() {
        int tmpId = buf[12];
        return tmpId;
    }

    public String toString() {
        String tmpStr = new StringBuffer("SGIP_SUBMIT_REP: ")
        .append("Src_node_Id=").append(getSrcNodeId())
        .append(",Time_Stamp=").append(getTimeStamp())
        .append(",Sequence_Id=").append(getSequenceId())
        .append(",Result=").append(getResult()).toString();
        return tmpStr;
    }

    public int getCommandId() {
        return SGIPCommon.SGIP_SUBMIT_RESP;
    }
}
